package com.yh.mapper;

import com.yh.javabean.Permission;
import com.yh.javabean.Product;
import org.apache.ibatis.annotations.*;
import java.util.List;

@Mapper
public interface PermissionMapper {

    @Select("select * from permission")
    List<Permission> selectAll();


    @Select("        select p.*\n" +
            "        from users u,role r,permission p,users_role ur,role_permission rp\n" +
            "        where u.id=ur.userId and r.id=ur.roleId and r.id=rp.roleId and p.id =rp.permissionId and u.id=#{uid}")
    List<Permission> selectByUid(int uid);

    int insert(Product product);

}
